package com.galaxy.product.domain.bo;

import com.galaxy.common.core.validate.AddGroup;
import com.galaxy.common.core.validate.EditGroup;
import com.galaxy.common.mybatis.core.domain.BaseEntity;
import com.galaxy.product.domain.ProductCategory;
import io.github.linpeilie.annotations.AutoMapper;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 商品分类业务对象
 */
@Data
@EqualsAndHashCode(callSuper = true)
@AutoMapper(target = ProductCategory.class)
public class ProductCategoryBo extends BaseEntity {

    /**
     * 主键
     */
    @NotNull(message = "主键不能为空", groups = {EditGroup.class})
    private Long id;

    /**
     * 分类名称
     */
    @NotBlank(message = "分类名称不能为空", groups = {AddGroup.class, EditGroup.class})
    @Size(max = 50, message = "分类名称长度不能超过50个字符")
    private String name;

    /**
     * 父分类ID
     */
    private Long parentId;

    /**
     * 层级(1-3)
     */
    @NotNull(message = "层级不能为空", groups = {AddGroup.class, EditGroup.class})
    private Integer level;

    /**
     * 图标URL
     */
    @NotNull(message = "不能为空", groups = { AddGroup.class, EditGroup.class })
    private String icon;

    /**
     * 排序
     */
    private Integer sort;

    /**
     * 状态(0:禁用,1:正常)
     */
    @NotNull(message = "状态不能为空", groups = {AddGroup.class, EditGroup.class})
    private Integer status;

    /**
     * 租户ID
     */
    private String tenantId;
}
